//
//  VisitorDetailCell.m
//  ppkc2016
//
//  Created by Laura on 2017/3/22.
//  Copyright © 2017年 拼凑的断音. All rights reserved.
//

#import "VisitorDetailCell.h"
#import "XXTool.h"
#import "VisitorInfoModel.h"

@interface VisitorDetailCell()

@property (nonatomic,strong) UILabel *cueLabel;
@property (nonatomic,strong) UILabel *contentLabel;

@end

@implementation VisitorDetailCell

-(UILabel*)cueLabel
{
    if (_cueLabel==nil)
    {
        _cueLabel = [[UILabel alloc] init];
        if ([XXTool didCurrentLanguageChinese])
        {
            _cueLabel.font = [XXTool boldSystemFontOfSize:16.5f];
        }
        else
        {
            _cueLabel.font = [XXTool boldSystemFontOfSize:15];
        }
        _cueLabel.textColor = [UIColor blackColor];
        [self addSubview:_cueLabel];
    }
    return _cueLabel;
}

-(UILabel*) contentLabel{
    if(_contentLabel == nil){
        _contentLabel=[[UILabel alloc]init];
        _contentLabel.font= [XXTool boldSystemFontOfSize:16.5f];
        _contentLabel.textColor=[UIColor blackColor];
        [self addSubview:_contentLabel];
    }
    return _contentLabel;
}

-(void) initUI{
    [self cueLabel];
    [self contentLabel];
}

-(void)refreshLayout:(CGRect)frame{
    _cueLabel.frame = CGRectMake(20
                                 , 0
                                 , 105
                                 , frame.size.height);
    _contentLabel.frame = CGRectMake(_cueLabel.frame.size.width+_cueLabel.frame.origin.x
                              , 0
                              , frame.size.width-(_cueLabel.frame.size.width+_cueLabel.frame.origin.x)
                              , frame.size.height);
}

-(void)setCellWitheData:(VisitorDetailModel *)data{
    _cueLabel.text=data.name;
    _contentLabel.text=data.value;
}

@end
